package com.songlanyun.common.enums;

import java.util.HashMap;
import java.util.Map;

public enum KqBankCardTyepEnum {

    CREDIT("0001", "信用卡"),//启用
    DEBIT("0002", "借记卡");//未启用

    private final String code;
    private final String desc;

    public String getCode() {
        return code;
    }

    public int getIntCode() {
        return Integer.parseInt(code);
    }

    public String getDesc() {
        return desc;
    }

    private static final Map lookup = new HashMap();

    static {
        for (KqBankCardTyepEnum e : KqBankCardTyepEnum.values()) {
            lookup.put(e.code, e);
        }
    }

    public static KqBankCardTyepEnum find(String code, KqBankCardTyepEnum defaultValue) {
        KqBankCardTyepEnum value = (KqBankCardTyepEnum) lookup.get(code);
        if (value == null) {
            return defaultValue;
        }
        return value;
    }


    KqBankCardTyepEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }
}
